Skip to main content

By Tag

Function - scrapeByTag()

  • Check if the cookies file is already set. If not the Check Out How to set Cookies
  • Remember, all functions return promises.

Arguments

scrapeByTag takes 2 arguments: scrapeByTag('cat', true)

  • Tag name
  • Boolean (true/false) - indicating whether you want to download the images or not

By default, the second argument is set to true (meaning images will be downloaded to a folder named 'Images').

Note: The import syntax (import ... from '@brahmbeyond/instareel') is used with ES6 modules, which are supported in Node.js version 14 and later, and in most modern browsers. If you're using an older version of Node.js or a runtime that doesn't support ES6 modules, you should use the require syntax instead (const ... = require('@brahmbeyond/instareel')).

insta.js
import {scrapeByTag} from '@brahmbeyond/instareel'
// const {scrapeByTag} = require('@brahmbeyond/instareel')

async function main() {
const images = await scrapeByTag('nature');
console.log(images); // This will log the array of image URLs
}

main().catch(console.error);

Download Images only

insta.js
import {scrapeByTag} from '@brahmbeyond/instareel'
// const {scrapeByTag} = require('@brahmbeyond/instareel')

async function main() {
await scrapeByTag('nature'); // this will download images only

}

main().catch(console.error);

Set second argument to false

insta.js
import {scrapeByTag} from '@brahmbeyond/instareel'
// const {scrapeByTag} = require('@brahmbeyond/instareel')

async function main() {
const images = await scrapeByTag('nature', false);
console.log(images); // This will log the array of image URLs
}

main().catch(console.error);

You can also use .then()

insta.js
import {scrapeByTag} from '@brahmbeyond/instareel'
// const {scrapeByTag} = require('@brahmbeyond/instareel')

scrapeByTag('nature', false).then(images => {
console.log(images); // This will log the array of image URLs
});